﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class flexy_admin_MasterPageUsers : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["RoleCode"] != null)
        {
            lbtName.Text = Session["Username"].ToString();
            lbtReg.Visible = false;
            lbtLogout.Visible = true;
        }
        else
        {
            lbtReg.Visible = true;
            lbtLogout.Visible = false;
            lbtName.Text = "Not login yet!";
        }

    }
    protected void lbtName_Click1(object sender, EventArgs e)
    {
        if (Session["RoleCode"] != null)
        {
            Response.Redirect("AccountDetails.aspx");
        }
        else
            Response.Redirect("Login.aspx");
    }
    protected void LinkButton1_Click(object sender, EventArgs e)
    {
        Session["RoleCode"] = null;
        Session["Username"] = null;
        Response.Redirect("Login.aspx");
    }
    protected void lbtReg_Click(object sender, EventArgs e)
    {
        Response.Redirect("RegisterForm.aspx");
    }
}
